package com.tl.boot.entity.demo.form.Base;

import io.swagger.annotations.ApiModelProperty;

/**
 * com.tl.boot.entity.demo.form.Base -- BaseForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/10 12:47
 */
public abstract class BaseForm {
    @ApiModelProperty( value = "用户ID", name = "userId", example = "1", hidden = true )
    private Long userId;
    @ApiModelProperty( value = "页码", name = "page", example = "1" )
    private Integer page;
    @ApiModelProperty( value = "每页显示数量", name = "size", example = "1" )
    private Integer size;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getPage() {
        return this.page == null ? 1 : this.page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getSize() {
        return this.size == null ? 20 : this.size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    /**
     * 检查参数是否合法
     */
    public abstract void checkParam();

}
